import requestProxy from '@/utils/request';

const { request } = requestProxy;

// 待处理的列表
export function getList(params, cancelToken) {
  return request({
    url: '/admin/todo/list',
    method: 'get',
    params,
    cancelToken
  });
}

// 待处理的列表
export function getReceiveList(params, cancelToken) {
  return request({
    url: '/admin/todo/receive/list',
    method: 'get',
    params,
    cancelToken
  });
}

// 待处理的列表
export function getReceiveTab() {
  return request({
    url: 'admin/todo/receive/tab',
    method: 'get'
  });
}

export function setListRead(id) {
  return request({
    url: `admin/todo/receive/list/read?id=${id}`,
    method: 'put'
  });
}

export function getDetailList(params) {
  return request({
    url: 'admin/todo/list/detail',
    method: 'get',
    params
  });
}

export function getContractList(params) {
  return request({
    url: 'admin/todo/list/detail/contract',
    method: 'get',
    params
  });
}

export function getFundList(params) {
  return request({
    url: 'admin/todo/list/detail/fund',
    method: 'get',
    params
  });
}

export function getProjectList(params) {
  return request({
    url: 'admin/todo/list/detail/project',
    method: 'get',
    params
  });
}

export function getChannelList(params) {
  return request({
    url: 'admin/todo/list/detail/channel',
    method: 'get',
    params
  });
}

export function getSettleData(params) {
  return request({
    url: 'admin/account/settle/list',
    method: 'get',
    params
  });
}
// 一键批量结算
export function batchSettle(data) {
  return request({
    url: `admin/account/settle/batchSettle`,
    method: 'post',
    data
  });
}
// 获取批量结算状态
export function batchSettleStatus(params) {
  return request({
    url: `admin/account/settle/settleStatus`,
    method: 'get',
    params
  });
}

export function updateSettleData(id, params) {
  return request({
    url: `admin/account/settle/update/${id}`,
    method: 'get',
    params
  });
}
export function updateSingleSettleData(params) {
  return request({
    url: `admin/account/smartSettle/update`,
    method: 'get',
    params
  });
}

export function getSettleTime(id) {
  return request({
    url: `admin/account/settle/info/${id}`,
    method: 'get'
  });
}

// 飞书待办数据列表
export function getFeishuTodoList(params, cancelToken) {
  return request({
    url: 'admin/todo/feishu/list',
    method: 'get',
    params,
    cancelToken
  });
}

// 清理飞书待办
export function clearFeishuTodo(data) {
  return request({
    url: 'admin/todo/feishu/clear',
    method: 'delete',
    data
  });
}

